package com.briup.day17;

/**
 * @author ThinkBook
 */
public class Test05_Week {
    public static void main(String[] args) {
//1.枚举元素引用格式：枚举类名.枚举元素名;
//注意枚举类名不能省略
        Week w1 = Week.MON;
        Week w2 = Week.FRI;
        Week w3 = Week.SAU;
//2.输出枚举对象，默认输出枚举元素名
        System.out.println(w1);
        System.out.println(w2.toString());
        System.out.println("-----------");
//3.获取枚举元素名：跟元素名一样的同名字符串
        System.out.println(w3.name());
//4.获取枚举元素编号：从0开始，逐个加1
        System.out.println(w1.ordinal()); //0
        System.out.println(w2.ordinal()); //1
        System.out.println(w3.ordinal()); //2

    }
}
enum Week{
    MON,FRI,SAU;
}
